package edu.uts.reekie.designer.execution;

import edu.uts.reekie.designer.AbstractViewEditor;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.jface.action.IAction;

import edu.uts.reekie.designer.AbstractContextMenuProvider;
import edu.uts.reekie.designer.AbstractViewEditor;
import edu.uts.reekie.designer.execution.actions.SetUnsetComponentActiveStereotypeAction;
import edu.uts.reekie.designer.execution.actions.SetUnsetComponentServiceStereotypeAction;
import edu.uts.reekie.designer.execution.actions.SetUnsetComponentUserInitiatedStereotypeAction;
import edu.uts.reekie.designer.execution.actions.*;
import edu.uts.reekie.designer.execution.edit.ViewPartFactory;
import edu.uts.reekie.designer.execution.model.ViewDiagram;
import edu.uts.reekie.designer.model.AbstractDiagram;

public class VE extends AbstractViewEditor  {


		
		@Override
		protected  void registerComponentActions(){
			
		}
		
		@Override
		protected void registerConnectorActions() {
			
			registerAction(new SetUnsetComponentActiveStereotypeAction(this, true));
			
			registerAction(new SetUnsetComponentActiveStereotypeAction(this, false));
			
			registerAction(new SetUnsetComponentUserInitiatedStereotypeAction(this, true));
			
			registerAction(new SetUnsetComponentUserInitiatedStereotypeAction(this, false));
			
			registerAction(new SetUnsetComponentServiceStereotypeAction(this, true));
			
			registerAction(new SetUnsetComponentServiceStereotypeAction(this, false));
			
			registerAction(new SetUnsetComponentServiceStereotypeAction(this, false));
			
			// register all the connector decoration actions
			for (SetConnectorDecorationAction.Factory f: SetConnectorDecorationAction.all().values()){
				registerAction(f.createAction(this));
			}
			
		}

		@Override
		protected AbstractContextMenuProvider createContextMenuProvider(EditPartViewer viewer) {
			return new ContextMenuProvider(viewer, getActionRegistry());
			
		}

		@Override
		protected AbstractDiagram createDiagram() {
			return new ViewDiagram();
		}

		@Override
		protected EditPartFactory createEditPartFactory() {
			return new ViewPartFactory();
		}

		@Override
		protected PaletteRoot createPaletteRoot() {
			
			return new ViewPaletteFactory().createPalette();
		}
		protected void createActions() {
			super.createActions();
		}
			
		
		
}
